@include('public.page_styles')
  <link rel="stylesheet" href="{{ asset("/AdminLTE/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css") }}">

</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
  @include('public.top')
  <!-- Left side column. contains the logo and sidebar -->
  @include('public.sidebar')
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper" >
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
          {{ trans('message.order') }}
        <small>{{ trans('message.list') }}</small>
      </h1>
      <ol class="breadcrumb">
        <li><a ><i class="fa fa-dashboard"></i> {{ trans('message.home') }}</a></li>
        <li><a >{{ trans('message.serviceManage') }}</a></li>
        <li class="active">{{ trans('message.orderManage') }}</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content" >
      <div class="row">
        <div class="col-xs-12">
          <div class="box">
              <div class="box-header">
                  <div class="pull-right">
                      <div class="btn-group pull-right" style="margin-right: 10px">
                          <span>
                            <a class="btn btn-sm btn-primary grid-refresh" onclick="refresh()"><i class="fa fa-refresh"></i> {{ trans('message.refresh') }}</a>
                          </span>
                      </div>
                  </div>
                  <form class="form_search" action="{{ url('order/list') }}" method="GET" style="margin-bottom:10px">
                      <div style="float:left;margin-right:5px">
                          <label>服务项目</label>
                          <select class="form-control" name="serveS">
                              <option value=""  class="input-xlarge option" >全部</option>
                              @if($serveProject)
                                  @foreach($serveProject as $key=>$serve)
                                      <option value="{{ $serve->serveType }}" @if($serveS == $serve->serveType ) selected @endif >{{ $serve->serveName }}</option>
                                  @endforeach
                              @endif
                          </select>
                      </div>
                      <div style="float:left;margin-right:5px">
                          <label>状态</label>
                          <select class="form-control" name="stateS">
                              <option value=""  class="input-xlarge option" >全部</option>
                              @if($orderSate)
                                  @foreach($orderSate as $key=>$state)
                                      @if($key <=5)
                                          <option value="{{ $state->state }}" @if($stateS == $state->state ) selected @endif >{{ $state->stateName }}</option>
                                      @endif
                                  @endforeach
                              @endif
                          </select>
                      </div>
                      <div style="float:left;margin-right:5px">
                          <label>门店</label>
                          <select class="form-control" name="shopS">
                              <option value=""  class="input-xlarge option" >全部</option>
                              @if($bankShop)
                                @foreach($bankShop as $shop)
                                      <option value="{{ $shop->id }}" @if($shopS == $shop->id ) selected @endif>{{ $shop->shopName }}</option>
                                @endforeach
                              @endif
                          </select>
                      </div>
                      <div style="float:left;margin-right:5px">
                          <label>关键字</label>
                          <input type="text" name="order_noS"  class="form-control input" placeholder="订单号或者车牌号" value="{{ $order_noS }}">
                      </div>
                      <div class="btn-toolbar" style="padding-top:25px;padding-bottom:0px;margin-bottom:0px">
                          <button type="submit" class="btn btn-primary">检索</button>
                      </div>
                  </form>
              </div>

            <!-- /.box-header -->
            <div class="box-body">
              <table id="example1" class="table table-bordered table-striped">
                <thead>
                  <tr>
                    <th>订单编号</th>
                    <th>归属用户</th>
                    <th>车牌号</th>
                    <th>服务</th>
                    <th>应付金额</th>
                    <th>实付金额</th>
                    <th>优惠方案</th>
                    <th>状态</th>
                    <th>操作</th>
                  </tr>
                </thead>
                <tbody>
                @if($orderList)
                  @foreach($orderList as $order)
                    <tr>
                      <td>{{ $order->order_no }}</td>
                      <td>{{ $order->phone }}</td>
                      <td>{{ $order->car_code }}</td>
                      <td>{{ $order->serveName }}</td>
                      <td>{{ $order->actual_money }}</td>
                      <td>{{ $order->order_money }}</td>
                      <td>{{ $order->couponName }}</td>
                      <td>{{state_config('order',$order->state) }}</td>
                      <td>
                          @if(in_array(getOptionId('查看详情'),$optionArr))
                              <a href="{{ url('order/'.$order->oid) }}"><i class="fa fa-eye"></i></a>　
                          @endif
                      </td>
                    </tr>
                  @endforeach
                @endif
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>
    </section>
  </div>
  <!-- /.content-wrapper -->
  @include('public.bottom')

  <!-- Control Sidebar -->
  {{--@include('public.aside')--}}
  <!-- /.control-sidebar -->
  <!-- Add the sidebar's background. This div must be placed
       immediately after the control sidebar -->
  <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->
@include('public.javascript')
<script src="{{ asset ("/AdminLTE/bower_components/datatables.net/js/jquery.dataTables.min.js") }}" type="text/javascript"></script>
<script src="{{ asset ("/AdminLTE/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js") }}" type="text/javascript"></script>
<script src="{{ asset ("/AdminLTE/bower_components/jquery-slimscroll/jquery.slimscroll.min.js") }}" type="text/javascript"></script>
{{--<script src="{{ asset ("/AdminLTE/bower_components/fastclick/lib/fastclick.js") }}" type="text/javascript"></script>--}}
<script src="{{ asset ("/js/bootbox.js") }}" type="text/javascript"></script>

<!-- page script -->
<script>
  $(function(){
      $('#example1').dataTable({
          "language": {
              "url":"{{ asset ("/AdminLTE/bower_components/datatables.net/chinese.json") }}"
          },
          "aaSorting": [[ 0, "desc" ]],//默认第几个排序
          "bStateSave": true,//状态保存
          "aoColumnDefs": [
              //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
//            {"orderable":false,"aTargets":[0,2,3,4,5,6,9]}// 制定列不参与排序
              {"orderable":false,"aTargets":[1,2,3,4,5,6,7,8]}// 制定列不参与排序
          ]
      });
      $('.table-sort tbody').on( 'click', 'tr', function () {
          if ( $(this).hasClass('selected') ) {
              $(this).removeClass('selected');
          }
          else {
              table.$('tr.selected').removeClass('selected');
              $(this).addClass('selected');
          }
      });

      @if(session()->has('success'))
         alertMess("{{session()->get('success')}}");
        {{--toastr.success("{{session()->get('success')}}");--}}
      @endif


  });

</script>
</body>
</html>
